<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" >

<%@ include file="../base/taglibs.jsp" %>
<%@ page session="true"%>

<html>
	<%@ include file="../base/head.jsp" %>

	<body>
		<div id="wrap">
			<%@ include file="../snipped/header.jsp"%>
			
			<div id="content">
				
				<h2>Uživatelé</h2>
				
				<table width="100%">
				
					<c:if test="${not user.roleAdmin}">
					<tr>
						<th></th>
						<th>Nick</th>
						<th>Jméno</th>
						<th>Příjmení</th>
						<th>Email</th>
						<th>Datum vytvoření</th>
						<th>Podpis</th>
					</tr>
					</c:if>
				
					<c:forEach items="${users}" var="u" varStatus="stat">
					<tr class="${stat.index % 2 == 0 ? 'odd' : 'even'}" id="row${stat.index}">
						<td>${stat.index + 1}.</td>
						
						<c:if test="${user.roleAdmin}">
						<td><c:out value="${u}"/></td>
						<td>
							<c:if test="${not u.roleAdmin}">
							<a href="<c:url value="/users/delete?nick=${u.nick}" />" onclick="return deleteRow(${stat.index});">
								<img alt="Smazat" src="<c:url value="/resources/images/remove.png" />" height="18" />
							</a>
							</c:if>
						</td>
						</c:if>
						
						<c:if test="${not user.roleAdmin}">
						<td><c:out value="${u.nick}"/></td>
						<td><c:out value="${u.name}"/></td>
						<td><c:out value="${u.surname}"/></td>
						<td><c:out value="${u.email}"/></td>
						<td><c:out value="${u.dateCreate}"/></td>
						<td><c:out value="${u.sign}"/></td>
						</c:if>
					</tr>
					</c:forEach>
					
				</table>
				
			</div>
			
			<br />
			<%@ include file="../snipped/footer.jsp"%>
		</div>
	</body>
	
</html>